//
//  EYClass.h
//  metadata
//
//  Created by easy on 11-5-27.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <objc/objc-runtime.h>
#import "EYMetadata.h"
#import "EYProperty.h"
#import "EYInstanceVariable.h"
#import "EYSelector.h"
#import "EYProtocol.h"
#import "EYMethod.h"
@interface EYClass : NSObject {
	Class own;
}
//class_getName class_setName
@property(nonatomic, readonly) NSString *name;

@property(nonatomic, readonly) Class ownClass;
//class_getSuperclass class_setSuperclass
@property(nonatomic, retain) EYClass *superClass;
//class_getVersion class_setVersion
@property(nonatomic, readonly) int version;
//class_getWeakIvarLayout class_setWeakIvarLayout
@property(nonatomic, retain) NSString *weakInstanceVariableLayout;
//class_getInstanceSize
@property(nonatomic, readonly) size_t instanceSize;
//class_getIvarLayout class_setIvarLayout
@property(nonatomic, retain) NSString *instanceVariableLayout;
#pragma mark init
+(id) init:(Class) clazz;
-(id) initWith:(Class)clazz;
#pragma mark -
#pragma mark instance
//class_createInstance  return a instance
-(id) createInstance:(size_t) extraBytes;
//class_isMetaClass
-(BOOL) isMetaClass;
#pragma mark property
//class_getProperty
-(EYProperty *) propertyWithName:(NSString *) name;
//class_copyPropertyList
-(NSArray /*EYProperty*/*) propertyList;
#pragma mark ivar
//class_getInstanceVariable
-(EYInstanceVariable *) instanceVariableWithName:(NSString *) name;
//class_getClassVariable
-(EYInstanceVariable *) classVariableWithName:(NSString *) name;
//class_copyIvarList
-(NSArray /*EYInstanceVariable*/ *) instanceVariableList;
//class_addIvar
-(BOOL) addInstanceVariable:(NSString *) name size:(size_t) size alignment:(uint8_t) alignment types:(NSString *) types;
#pragma mark method
//class_getClassMethod
-(EYMethod *) classMethodWith:(SEL) selector;
//class_getInstanceMethod
-(EYMethod *) instanceMethodWith:(SEL) selector;
//class_addMethod
-(BOOL) addMethod:(SEL) selector imp:(IMP) imp types:(NSString *)types;
//class_copyMethodList
-(NSArray /*EYMethod*/*) methodList;
//class_getMethodImplementation
-(IMP) methodImplementationWith:(SEL) selector;
//class_getMethodImplementation_stret
-(IMP) methodImplementationStretWith:(SEL)selector;
//class_replaceMethod
-(IMP) replaceMethod:(SEL)selector imp:(IMP) imp types:(NSString *) types;
#pragma mark sel
//class_respondsToSelector
-(BOOL) respondsToSelector:(EYSelector *)aSelector;

#pragma mark protocol
//class_addProtocol
-(BOOL) addProtocol:(EYProtocol *) protocol;
//class_conformsToProtocol
-(BOOL) conformsToProtocol:(EYProtocol *)protocol;
//class_copyProtocolList
-(NSArray /*EYProtocol*/ *) protocolList;

@end
